/* Benegal/Azevedo/Holman, 2014-2020 CES */

clear
set scheme cblind1
set more off
**** set working directory****


// Table 2 - aggregate results with ordinal scales for pid + ideo

eststo clear
quietly reg envsupport pid7 age educlevel sex income i.surv if race==1 [pw=cweight]
eststo White_pid
quietly reg envsupport pid7 age educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black_pid
quietly reg envsupport pid7 age educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic_pid
quietly reg envsupport pid7 age educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian_pid

quietly reg envsupport ideology5a age educlevel sex income i.surv if race==1 [pw=cweight]
eststo White_ideo
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black_ideo
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic_ideo
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian_ideo

		# delimit ;
		esttab White_pid White_ideo Black_pid Black_ideo Hispanic_pid Hispanic_ideo Asian_pid Asian_ideo using table2.rtf, nogap se b(%9.3f) starlevels(* .05) r2(%9.3f) ///
			title("CES 2014-20: Env policy support")
			 label nonumbers 
			 mtitle("White" "" "Black" ""  "Hispanic" "" "Asian" "" ) 
			addnote("Dependent variable: Aggregate support. Ordinary least squares regression with survey weights applied. Survey year fixed effects.") 
			compress replace;
		#delimit cr	
		
		
	
eststo clear
quietly reg envsupport b4.pid7 age educlevel sex income i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport b4.pid7 age educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport b4.pid7 age educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport b4.pid7 age educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian

		# delimit ;
		esttab 	using appendixA1.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, PID7 measure")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	

		
eststo clear
quietly reg envsupport b3.ideology5a age educlevel sex income i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport b3.ideology5a age educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport b3.ideology5a age educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport b3.ideology5a age educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian

		# delimit ;
		esttab 	using appendixA2.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, ideology  measure")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
		
			
eststo clear
quietly reg envsupport pid7 ideology5a age educlevel sex income i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 ideology5a age educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 ideology5a age educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 ideology5a age educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian

		# delimit ;
		esttab 	using AppendixB1.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support using both partisanship and ideology  measures")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
		
// Figure 1 in separate Excel file with collapsed data for descriptive graph

// Figure 2: Partisanship margins plots
set scheme cblind1
set more off
eststo clear
quietly reg envsupport pid7 age educlevel sex income i.surv if race==1 [pw=cweight]
margins, at(pid7=(1(1)7))   atmeans post 
estimates store White
quietly reg envsupport pid7 age educlevel sex income i.surv if race==2 [pw=cweight]
margins, at(pid7=(1(1)7))   atmeans post 
estimates store Black
quietly reg envsupport pid7 age educlevel sex income i.surv if race==3 [pw=cweight]
margins, at(pid7=(1(1)7))   atmeans post 
estimates store Hispanic
quietly reg envsupport pid7 age educlevel sex income i.surv if race==4 [pw=cweight]
margins, at(pid7=(1(1)7))   atmeans post 
estimates store Asian

	coefplot (White, label (White) msymbol(D)) (Black, label (Black) msymbol(T)) (Hispanic, label (Hispanic) msymbol(S)) (Asian, label (Asian) msymbol(O)) ///
	||, ytitle ("% Supporting") ///
	xlab(1 "Strong Dem" 2" Democratic" 3 "Lean Dem" 4 "Independent" 5 "Lean Rep" 6 "Republican" 7 "Strong Rep" , labsize(vsmall)) xtitle ("Partisanship") ///
	ylab(0 "0%" .5 "50%" 1 "100%", labsize(vsmall)) ///
	at recast(connected) lwidth(*2) ciopts(recast(rline) lc(gray) lp(-) lw(vthin)) ///
	legend (rows(1) pos(6))
	graph save "figure2.gph", replace
	graph export "figure2.png", replace width(1800)
	
		
// Figure 3: Ideology margins plots

// Ideology margins plots
set more off
eststo clear
quietly reg envsupport ideology5 age educlevel sex income i.surv if race==1 [pw=cweight]
margins, at(ideology5=(1(1)5))   atmeans post 
estimates store White
quietly reg envsupport ideology5 age educlevel sex income i.surv if race==2 [pw=cweight]
margins, at(ideology5=(1(1)5))   atmeans post 
estimates store Black
quietly reg envsupport ideology5 age educlevel sex income i.surv if race==3 [pw=cweight]
margins, at(ideology5=(1(1)5))   atmeans post 
estimates store Hispanic
quietly reg envsupport ideology5 age educlevel sex income i.surv if race==4 [pw=cweight]
margins, at(ideology5=(1(1)5))   atmeans post 
estimates store Asian

	coefplot (White, label (White) msymbol(D)) (Black, label (Black) msymbol(T)) (Hispanic, label (Hispanic) msymbol(S)) (Asian, label (Asian) msymbol(O)) ///
	||, ytitle ("% Supporting")   ///
	xlab(1 "V. liberal" 2 "Liberal" 3 "Moderate" 4 "Conservative" 5 "V. conservative" , labsize(vsmall)) xtitle ("Ideology") ///
	ylab(0 "0%" .5 "50%" 1 "100%", labsize(vsmall)) ///
	at recast(connected) lwidth(*2) ciopts(recast(rline) lc(gray) lp(-) lw(vthin)) ///
	legend (rows(1) pos(6))
	graph save "figure3.gph", replace
	graph export "figure3.png", replace width(1800)
	

// educ bar graph
	
set more off
eststo clear
quietly reg envsupport pid7 age educlevel sex income i.surv if race==1 [pw=cweight]
eststo White: margins, at(educlevel=(1(1)5)) atmeans post
quietly reg envsupport pid7 age educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black: margins, at(educlevel=(1(1)5)) atmeans post
quietly reg envsupport pid7 age educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic: margins, at(educlevel=(1(1)5)) atmeans post
quietly reg envsupport pid7 age educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian: margins, at(educlevel=(1(1)5)) atmeans post
estimates store Asian

coefplot (White), xtitle("White") ytitle("Aggregate support") vertical recast(bar) barwidth(0.9) fcolor(*.6) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "HS" 2 "Some coll" 3 "2-yr" 4 "4-yr" 5 "Post-grad", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(eduW.gph, replace)

coefplot (Black), xtitle("Black") vertical recast(bar) barwidth(0.9) fcolor(*.45) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "HS" 2 "Some coll" 3 "2-yr" 4 "4-yr" 5 "Post-grad", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(eduB.gph, replace)
	
coefplot (Hispanic), xtitle("Hispanic") vertical recast(bar) barwidth(0.9) fcolor(*.3) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "HS" 2 "Some coll" 3 "2-yr" 4 "4-yr" 5 "Post-grad", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(eduH.gph, replace)
	
coefplot (Asian), xtitle("Asian") vertical recast(bar) barwidth(0.9) fcolor(*.15) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "HS" 2 "Some coll" 3 "2-yr" 4 "4-yr" 5 "Post-grad", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(edyA.gph, replace)
	
graph combine eduW.gph eduB.gph eduH.gph eduA.gph, cols(4) imargin(0 0 0 0) ycommon 	
	graph save "figure4.gph", replace
	graph export "figure4.png", replace width(1800)
	
	
// Fig 5: agecategories

eststo clear
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==1 [pw=cweight]
eststo White: margins, at(agedem=(1(1)6))  atmeans post
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black: margins, at(agedem=(1(1)6))  atmeans post
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic: margins, at(agedem=(1(1)6))  atmeans post
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian: margins, at(agedem=(1(1)6))  atmeans post

coefplot (White), xtitle("White") ytitle("Aggregate support") vertical recast(bar) barwidth(0.9) fcolor(*.6) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "<25" 2 "25-30" 3 "31-40" 4 "41-50" 5 "51-64" 6 "65+", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(ageW.gph, replace)

coefplot (Black), xtitle("Black") vertical recast(bar) barwidth(0.9) fcolor(*.45) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "<25" 2 "25-30" 3 "31-40" 4 "41-50" 5 "51-64" 6 "65+", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(ageB.gph, replace)
	
coefplot (Hispanic), xtitle("Hispanic") vertical recast(bar) barwidth(0.9) fcolor(*.3) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "<25" 2 "25-30" 3 "31-40" 4 "41-50" 5 "51-64" 6 "65+", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(ageH.gph, replace)
	
coefplot (Asian), xtitle("Asian") vertical recast(bar) barwidth(0.9) fcolor(*.15) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "<25" 2 "25-30" 3 "31-40" 4 "41-50" 5 "51-64" 6 "65+", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(ageA.gph, replace)
	
graph combine ageW.gph ageB.gph ageH.gph ageA.gph, cols(4) imargin(0 0 0 0) ycommon 
	graph save "figure5.gph", replace
	graph export "figure5.png", replace width(1800)
	
		# delimit ;
		esttab 	using appendixA4.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, age categories")
			 label nonumbers
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		

	
// Fig 5: gender categories

eststo clear
quietly reg envsupport pid7 agedem educlevel sex income i.surv if race==1 [pw=cweight]
eststo White: margins, at(sex=(0(1)1))  atmeans post
quietly reg envsupport pid7 agedem educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black: margins, at(sex=(0(1)1))  atmeans post
quietly reg envsupport pid7 agedem educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic: margins, at(sex=(0(1)1))  atmeans post
quietly reg envsupport pid7 agedem educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian: margins, at(sex=(0(1)1))  atmeans post

coefplot (White), xtitle("White") ytitle("Aggregate support") vertical recast(bar) barwidth(0.9) fcolor(*.6) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "Men" 2 "Women", labsize(small))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(genderW.gph, replace)

coefplot (Black), xtitle("Black") vertical recast(bar) barwidth(0.9) fcolor(*.45) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "Men" 2 "Women", labsize(small))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(genderB.gph, replace)
	
coefplot (Hispanic), xtitle("Hispanic") vertical recast(bar) barwidth(0.9) fcolor(*.3) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "Men" 2 "Women", labsize(small))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(genderH.gph, replace)
	
coefplot (Asian), xtitle("Asian") vertical recast(bar) barwidth(0.9) fcolor(*.15) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "Men" 2 "Women", labsize(small))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(genderA.gph, replace)
	
graph combine genderW.gph genderB.gph genderH.gph genderA.gph, cols(4) imargin(0 0 0 0) ycommon 	
	graph save "figure6.gph", replace
	graph export "figure6.png", replace width(1800)


	**** income **** 
	
set more off
eststo clear
quietly reg envsupport pid7 age educlevel sex incq i.surv if race==1 [pw=cweight]
eststo White: margins, at(incq=(1(1)5)) atmeans post
quietly reg envsupport pid7 age educlevel sex incq i.surv if race==2 [pw=cweight]
eststo Black: margins, at(incq=(1(1)5)) atmeans post
quietly reg envsupport pid7 age educlevel sex incq i.surv if race==3 [pw=cweight]
eststo Hispanic: margins, at(incq=(1(1)5)) atmeans post
quietly reg envsupport pid7 age educlevel sex incq i.surv if race==4 [pw=cweight]
eststo Asian: margins, at(incq=(1(1)5)) atmeans post
estimates store Asian

coefplot (White), xtitle("White") ytitle("Aggregate support") vertical recast(bar) barwidth(0.9) fcolor(*.6) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "20%" 2 "40%" 3 "60%" 4 "80%" 5 "100%", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(incW.gph, replace)

coefplot (Black), xtitle("Black") vertical recast(bar) barwidth(0.9) fcolor(*.45) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "20%" 2 "40%" 3 "60%" 4 "80%" 5 "100%", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(incB.gph, replace)
	
coefplot (Hispanic), xtitle("Hispanic") vertical recast(bar) barwidth(0.9) fcolor(*.3) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "20%" 2 "40%" 3 "60%" 4 "80%" 5 "100%", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(incH.gph, replace)
	
coefplot (Asian), xtitle("Asian") vertical recast(bar) barwidth(0.9) fcolor(*.15) ///
	ciopts(recast(rcap)) citop citype(normal) format(%9.2f) ///
	xlab(1 "20%" 2 "40%" 3 "60%" 4 "80%" 5 "100%", labsize(vsmall))  ///
	ylab(.25 "25%" .5 "50%" .75 "75%" 1 "100%", labsize(vsmall)) saving(incA.gph, replace)
	
graph combine incW.gph incB.gph incH.gph incA.gph, cols(4) imargin(0 0 0 0) ycommon 	
	graph save "figure7.gph", replace
	graph export "figure7.png", replace width(1800)





set more off
eststo clear
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==4 [pw=cweight]
eststo Asian

		# delimit ;
		esttab 	using appendixA5.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, income quintiles")
			 label nonumbers
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
  
// Fig 4: agecategories
eststo clear
quietly reg envsupport pid7 i.agedem educlevel sex income surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 i.agedem educlevel sex income surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 i.agedem educlevel sex income surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 i.agedem educlevel sex income surv if race==4 [pw=cweight]
eststo Asian


		# delimit ;
		esttab 	using appendixA4.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, age categories")
			 label nonumbers
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
coefplot (White, msymbol(X)) (Black, msymbol(O)) (Hispanic, msymbol(D)) (Asian, msymbol(S)), xline(0) title("Aggregate support") ///
keep(*agedem) legend(pos(6) row(1))

// educ
eststo clear
quietly reg envsupport pid7 agedem i.educlevel sex income surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 agedem i.educlevel sex income surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 agedem i.educlevel sex income surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 agedem i.educlevel sex income surv if race==4 [pw=cweight]
eststo Asian

		# delimit ;
		esttab 	using appendixA3.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, educational attainment categories")
			 label nonumbers
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	


//////////////////////////////////////

eststo clear
quietly reg envsupport pid7 age i.educlevel sex income i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 age i.educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 age i.educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 age i.educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian

		# delimit ;
		esttab 	using appendixA3.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix A3: Table with expanded (categorical) educational attainment measure")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
		
eststo clear
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 i.agedem educlevel sex income i.surv if race==4 [pw=cweight]
eststo Asian


		# delimit ;
		esttab 	using appendixA4.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix A4: Table with expanded (categorical) age demographics")
			 label nonumbers
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
		
		
eststo clear
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==1 [pw=cweight]
eststo White
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==2 [pw=cweight]
eststo Black
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==3 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 agedem educlevel sex b3.incq i.surv if race==4 [pw=cweight]
eststo Asian


		# delimit ;
		esttab 	using appendixA5.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix A5: Results with income quintiles")
			 label nonumbers
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	

		
eststo clear
quietly reg envsupport pid7 age educlevel sex income if race==1 & surv==2014 [pw=cweight]
eststo White
quietly reg envsupport pid7 age educlevel sex income if race==2 & surv==2014 [pw=cweight]
eststo Black
quietly reg envsupport pid7 age educlevel sex income if race==3 & surv==2014 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 age educlevel sex income if race==4 & surv==2014 [pw=cweight]
eststo Asian
quietly reg envsupport ideology5a age educlevel sex income if race==1 & surv==2014 [pw=cweight]
eststo White2
quietly reg envsupport ideology5a age educlevel sex income if race==2 & surv==2014 [pw=cweight]
eststo Black2
quietly reg envsupport ideology5a age educlevel sex income if race==3 & surv==2014 [pw=cweight]
eststo Hispanic2
quietly reg envsupport ideology5a age educlevel sex income if race==4 & surv==2014 [pw=cweight]
eststo Asian2

		# delimit ;
		esttab 	using AppendixB2a.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix B2: Results from Table 2 for only 2014")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" "White" "Black" "Hispanic" "Asian")
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
		
eststo clear
quietly reg envsupport pid7 age educlevel sex income if race==1 & surv==2016 [pw=cweight]
eststo White
quietly reg envsupport pid7 age educlevel sex income if race==2 & surv==2016 [pw=cweight]
eststo Black
quietly reg envsupport pid7 age educlevel sex income if race==3 & surv==2016 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 age educlevel sex income if race==4 & surv==2016 [pw=cweight]
eststo Asian
quietly reg envsupport ideology5a age educlevel sex income if race==1 & surv==2016 [pw=cweight]
eststo White2
quietly reg envsupport ideology5a age educlevel sex income if race==2 & surv==2016 [pw=cweight]
eststo Black2
quietly reg envsupport ideology5a age educlevel sex income if race==3 & surv==2016 [pw=cweight]
eststo Hispanic2
quietly reg envsupport ideology5a age educlevel sex income if race==4 & surv==2016 [pw=cweight]
eststo Asian2

		# delimit ;
		esttab 	using AppendixB2b.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix B3: Results from Table 2 for only 2016")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" "White" "Black" "Hispanic" "Asian")
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	

	
eststo clear
quietly reg envsupport pid7 age educlevel sex income if race==1 & surv==2018 [pw=cweight]
eststo White
quietly reg envsupport pid7 age educlevel sex income if race==2 & surv==2018 [pw=cweight]
eststo Black
quietly reg envsupport pid7 age educlevel sex income if race==3 & surv==2018 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 age educlevel sex income if race==4 & surv==2018 [pw=cweight]
eststo Asian
quietly reg envsupport ideology5a age educlevel sex income if race==1 & surv==2018 [pw=cweight]
eststo White2
quietly reg envsupport ideology5a age educlevel sex income if race==2 & surv==2018 [pw=cweight]
eststo Black2
quietly reg envsupport ideology5a age educlevel sex income if race==3 & surv==2018 [pw=cweight]
eststo Hispanic2
quietly reg envsupport ideology5a age educlevel sex income if race==4 & surv==2018 [pw=cweight]
eststo Asian2

		# delimit ;
		esttab 	using AppendixB2c.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix B2: Results from Table 2 for only 2018")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" "White" "Black" "Hispanic" "Asian")
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	

		
eststo clear
quietly reg envsupport pid7 age educlevel sex income if race==1 & surv==2020 [pw=cweight]
eststo White
quietly reg envsupport pid7 age educlevel sex income if race==2 & surv==2020 [pw=cweight]
eststo Black
quietly reg envsupport pid7 age educlevel sex income if race==3 & surv==2020 [pw=cweight]
eststo Hispanic
quietly reg envsupport pid7 age educlevel sex income if race==4 & surv==2020 [pw=cweight]
eststo Asian
quietly reg envsupport ideology5a age educlevel sex income if race==1 & surv==2020 [pw=cweight]
eststo White2
quietly reg envsupport ideology5a age educlevel sex income if race==2 & surv==2020 [pw=cweight]
eststo Black2
quietly reg envsupport ideology5a age educlevel sex income if race==3 & surv==2020 [pw=cweight]
eststo Hispanic2
quietly reg envsupport ideology5a age educlevel sex income if race==4 & surv==2020 [pw=cweight]
eststo Asian2

		# delimit ;
		esttab 	using AppendixB2d.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("Appendix B2: Results from Table 2 for only 2020")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" "White" "Black" "Hispanic" "Asian")
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	

		
		
		
		
// alternate specification for hispanic including people who don't primarily identify (e.g. Black Hispanic)

eststo clear
quietly reg envsupport pid7 age educlevel sex income i.surv if race==3 [pw=cweight]
eststo H1
quietly reg envsupport pid7 age educlevel sex income i.surv if hisp2==1 [pw=cweight]
eststo H2
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==3 [pw=cweight]
eststo H3
quietly reg envsupport ideology5a age educlevel sex income i.surv if hisp2==1 [pw=cweight]
eststo H4

		# delimit ;
		esttab 	using appendixB4.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, PID7 measure")
			 label nonumbers 
			 mtitle("Primary" "Expanded" "Primary" "Expanded" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
		
eststo clear
quietly reg envsupport pid7 age educlevel sex income i.surv if race==6 [pw=cweight]
eststo H1
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==6 [pw=cweight]
eststo H2

		# delimit ;
		esttab 	using envpol_mixed.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, PID7 measure")
			 label nonumbers 
			 mtitle("Primary" "Expanded" "Primary" "Expanded" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	

		
**** no weights **** 
		
eststo clear

quietly reg envsupport pid7 age educlevel sex income i.surv if race==1 
eststo White_pid
quietly reg envsupport pid7 age educlevel sex income i.surv if race==2 
eststo Black_pid
quietly reg envsupport pid7 age educlevel sex income i.surv if race==3 
eststo Hispanic_pid
quietly reg envsupport pid7 age educlevel sex income i.surv if race==4 
eststo Asian_pid

quietly reg envsupport ideology5a age educlevel sex income i.surv if race==1 
eststo White_ideo
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==2 
eststo Black_ideo
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==3 
eststo Hispanic_ideo
quietly reg envsupport ideology5a age educlevel sex income i.surv if race==4 
eststo Asian_ideo

		# delimit ;
		esttab 	using appendixB3.rtf, nogap se b(%9.3f) starlevels(* .05 ** .01 *** .001) r2(%9.3f) ///
			title("CES 2014-20: Env policy support, PID7 measure")
			 label nonumbers 
			 mtitle("White" "Black" "Hispanic" "Asian" )
			//addnote("Dependent variable")//
			compress replace;
		#delimit cr	
